package com.jrx.anytxn.param.mapper.ext;

import com.jrx.anytxn.common.annotation.ParamTuningAnnotation;
import com.jrx.anytxn.param.entity.PmPartnerInfo;
import com.jrx.anytxn.param.mapper.base.PmPartnerInfoMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public interface ExtPmPartnerInfoMapper extends PmPartnerInfoMapper {

    PmPartnerInfo selectByTenantIdAndPartnerId(@Param("tenantId") String tenantId, @Param("partnerId") String partnerId);

    PmPartnerInfo selectByTemplateIdAndOrgIdAndTenantIdAndTableStatus(@Param("partnerId") String partnerId, @Param("organizationId") String organizationId, @Param("tenantId") String tenantId,@Param("tableStatus") String tableStatus);

    List<PmPartnerInfo> selectByTenantId(@Param("tenantId") String tenantId,@Param("tableStatus") String tableStatus);

    @ParamTuningAnnotation
    int updateByTenantIdAndPartnerId(PmPartnerInfo pmPartnerInfo);

    @ParamTuningAnnotation
    int deleteByTenantIdAndPartnerId(@Param("tenantId") String tenantId, @Param("partnerId") String partnerId);

    List<PmPartnerInfo> findByOrgIdForBatch(@Param("organizationId") String organizationId);

    int batchUpdatePmPartnerInfo(List<PmPartnerInfo> pmPartnerInfoList);
}
